package com.itheima.mp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.mp.domain.dto.PageDTO;
import com.itheima.mp.domain.po.User;
import com.itheima.mp.domain.query.UserQuery;
import com.itheima.mp.domain.vo.UserVO;
import org.springframework.stereotype.Service;

import java.util.List;


public interface UserService extends IService<User> {

    /**
     * 根据id扣减余额
     * @param id
     * @param amount
     */
    void deduction(Long id, Integer amount);

    /**
     * 根据id查询用户和地址信息
     * @param id
     * @return
     */
    UserVO getUserAndAddressById(Long id);

    /**
     * 批量查询用户信息和收货地址
     * @param ids
     * @return
     */
    List<UserVO> getUserAndAddressByIds(List<Long> ids);

    /**
     * 分页查询
     * @param userQuery
     * @return
     */
    PageDTO<UserVO> pageQuery(UserQuery userQuery);
}
